package com.woniuxy.sensitive.config;

import com.baidu.aip.contentcensor.AipContentCensor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BaiduAipConfig {
    @Value("${baidu.aip.appId}")
    private String appId;

    @Value("${baidu.aip.apiKey}")
    private String apiKey;

    @Value("${baidu.aip.secretKey}")
    private String secretKey;

    @Bean
    public AipContentCensor aipContentCensor() {
        AipContentCensor client = new AipContentCensor(appId, apiKey, secretKey);
        client.setConnectionTimeoutInMillis(2000);
        client.setSocketTimeoutInMillis(60000);
        return client;
    }
}
